package com.example.demo.app;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import lombok.Getter;
import lombok.Setter;


@Getter
@Setter
public class Book {
	
	private String name;
	
	private Date publishDate;
	
	private String author;
	
	@NotNull
    @Range(min = 0, max = 1, message = "性别1=男;0-女")
	private int sex;
	
	@Pattern(regexp = "^1(3|4|5|7|8)\\d{9}$",message = "手机号码格式错误")
    @NotBlank(message = "手机号码不能为空")
	private String phone;
	
	public Book() {}

}
